#ifndef GETSERVERFROMDB_H
#define GETSERVERFROMDB_H

#include <QDialog>
#include <QSqlQuery>
#include "computer.h"

namespace Ui {
class GETSERVERFROMDB;
}

class GETSERVERFROMDB : public QDialog
{
    Q_OBJECT

public:
    explicit GETSERVERFROMDB(QWidget *parent = 0);
    ~GETSERVERFROMDB();

private slots:

    void on_cancelButton_clicked(bool checked);

    void on_getButton_clicked(bool checked);

private:
    bool connectDB(QString ip,int port,QString DBName,QString userName,QString password,QSqlDatabase &mysqlDB);

    void saveComputer(QString &ip,QString &name,QString &server,QString &dbName);
private:
    Ui::GETSERVERFROMDB *ui;
};

#endif // GETSERVERFROMDB_H
